package com.cdd.servicezhifubao.controller;

import com.cdd.servicezhifubao.service.AccountService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description TODO
 * @Author: cdd
 * @Date: 2020/7/9 15:10
 * @Version: 1.0
 */
@RestController
public class AccountController {

    @Resource
    AccountService accountService;

    @GetMapping("/getById")
    public Object getById(Long id) {
        return accountService.getById(id);
    }

    @GetMapping("/withdraw/{amount}")
    public String updateAccountById(@PathVariable Integer amount) {
        int rs = accountService.updateAccountById(amount);
        if (rs == 1) {
            return "支付宝提现成功";
        } else {
            return "支付宝提现失败";
        }
    }
}
